# coding=utf-8

from __future__ import print_function

import cx_Oracle
import mysql.connector

from mysql.connector import errorcode


try:
    cnx = mysql.connector.connect(user='root', password='',
        host='127.0.0.1',
        port=3309,
        database='test')

    cursor = cnx.cursor()
    cursor.execute("""create table t_test(id int auto_increment primary key,
        name varchar(30),
        birth datetime)""")
    
    cursor.close()

except mysql.connector.Error as err:
    if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
        print("Something is wrong with your user name or password")
    elif err.errno == errorcode.ER_BAD_DB_ERROR:
        print("Database does not exists")
    else:
        print(err)
else:
    cnx.close()
